import { PartialType } from '@nestjs/swagger';
import { IsOptional } from 'class-validator';
import { Decorator_DtoIsNumber_Base } from '@/common/decorators/dtoIsNumber';
import { ApiProperty } from '@nestjs/swagger';
import { IsNotEmpty, IsString } from 'class-validator';

export class Spec_Create_Dto {
  @IsString()
  @IsNotEmpty()
  @ApiProperty({ description: '规格属性名称' })
  specName: string;

  @Decorator_DtoIsNumber_Base()
  @IsNotEmpty()
  @ApiProperty({ description: '规格属性类型ID' })
  specsTypeId: number;
}

export class Spec_Update_Dto extends PartialType(Spec_Create_Dto) {
  @Decorator_DtoIsNumber_Base()
  @IsOptional()
  id: number;
}
